import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/', redirect: '/Login',
    },
    {
      path: '/Login',
      component: () => import('./components/Login.vue')
    },
    {
      path: '/home',
      component: () => import('./components/Home.vue'),
      redirect: '/Welcome',
      children: [
        {
          path: '/Welcome',
          component: () => import('./views/index/Welcome.vue'),
        },
        {
          path: '/users',
          component: () => import('./views/user/User.vue'),
        },
        {
          path: '/roles',
          component: () => import('./views/power/Rights.vue'),
        },
        {
          path: '/rights',
          component: () => import('./views/power/Roles.vue'),
        },
        {
          path: '/categories',
          component: () => import('./views/goods/Cate.vue'),
        },
        {
          path: '/params',
          component: () => import('./views/goods/Params.vue'),
        },
        {
          path: '/goods',
          component: () => import('./views/goods/List.vue'),
        },
        {
          path: '/goods/add',
          component: () => import('./views/goods/Add.vue'),
        },
        {
          path: '/orders',
          component: () => import('./views/order/Order.vue'),
        },
        {
          path: '/reports',
          component: () => import('./views/report/Report.vue'),
        },
      ]
    }
  ]
})
